<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>LoadFromBuffer Method</TITLE>
<link rel="stylesheet" type="text/css" href="help.css">
</HEAD>

<BODY class="v114">

<OBJECT TYPE="application/x-oleobject" CLASSID="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
	<PARAM NAME="Keyword" VALUE="LoadFromBuffer Method">
</OBJECT>

<H1><A NAME="loadfrombuffer_method"></A><B>LoadFromBuffer Method</B></H1>
<HR>

<H2 class="AppliesTo">Applies to</H2>
<P><A HREF="thtmlviewer_component.htm">THtmlViewer</A> component</P>

<H2 class="deprecated">Deprecated</H2>
<P>Use methods <A HREF="LoadFromDocument_method.htm">LoadFromDocument</A> or <A HREF="LoadFromString_method.htm">LoadFromString</A> instead.</P>

<H2 class="Declaration">Declaration</H2>

<P>procedure LoadFromBuffer(Buffer: PChar; BufSize: LongInt; const Reference: <A href="type_thtstring.htm">ThtString</A> = '');</P>

<H2 class="Description">Description</H2>

<P>The LoadFromBuffer method loads an HTML document from a memory buffer.  BufSize is the number of characters to be loaded.  A terminating null character is not required.</P>

<P><I>Reference</I> is an optional <A HREF="reference.htm">reference</A> parameter.</P>

<H2 class="Example">Example</H2>

<P>Assume an HTML document exists in a TMemo object.  The following code could be used to then copy the document to an THtmlViewer object:</P>

<PRE>
var
	Buffer: PChar;
	Size: integer;
begin
	Size := Memo1.GetTextLen;
	Inc(Size);
	GetMem(Buffer, Size);
	Memo1.GetTextBuf(Buffer,Size);
	Viewer.LoadFromBuffer(Buffer, Size-1);
	FreeMem(Buffer, Size);
end;
</PRE>

<H2 class"SeeAlso">See also</H2>
<UL class="SeeAlso">
<LI><A HREF="loadfromdocument_method.htm">LoadFromDocument Method</A>
<LI><A HREF="loadfromfile_method.htm">LoadFromFile Method</A>
<LI><A HREF="loadfromstream_method.htm">LoadFromStream Method</A>
<LI><A HREF="loadfromstring_method.htm">LoadFromString Method</A>
<LI><A HREF="onhtstreamrequest_event.htm">OnhtStreamRequest Event</A>
</UL>

</BODY>
</HTML>
